﻿@using WebApp.Extensions
@model Dto.ApiResponses.FolderResponses.FolderDetailResponse
@{
    ViewBag.CurrentPage = WebApp.Common.PageSetting.FolderEditPageSetting;
    var sectionId = (Request.IsAjaxRequest() ? "Ajax" : "View") + "_Folder_Edit_" + Model.Detail.Id;
}

@section Scripts{
    <script type="text/javascript">
        require(['Folder/Edit', 'Util'], function (api, util) {
            var model = util.toJS(@(Html.ToJson(Model)));
            $(function () { api.exec('@sectionId', model); });
        });
    </script>
}

<div class="container" data-bind="stopbinding: true">
    <section id="@sectionId">
        <div class="row ">
            <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="photo">Photo</label>
                            <div class="fileDragHolder">
                                <canvas id="imgCanvas" width="150" height="187"></canvas>
                                <div>
                                    <a id="photo" href="#" data-bind="click: selectPhoto">Select File</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="name">Name</label>
                            <div id="name" data-bind="text:name"></div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="tags">Tags</label>
                            <input id="tags" type="text" class="form-control" data-bind="value : tags" required />
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="AName">Account Name</label>
                            <div id="AName" data-bind="text:referenceName"></div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="form-group">
                        <div class="col-md-10">
                            <label for="description">Description</label>
                            <textarea id="description" class="form-control" rows="3" data-bind="value : description"></textarea>
                        </div>
                    </div>
                </div>
                <div class="form-group ">
                    <div class=" col-sm-3"></div>
                    <div class="text-info col-sm-5 col-md-7"><button class="btn btn-primary btn-lg" data-bind="click:submit">Submit</button>&nbsp;&nbsp;&nbsp;&nbsp;<button class="btn btn-primary btn-lg" data-bind="click:cancel">Cancel</button></div>
                </div>
            </div>
        </div>
    </section>
</div>
